x <- Today() # the same as Sys.Date() but maybe easier to remember..
Year(x)
Quarter(x)
Month(x)
Month(x, fmt = "mm", lang="engl")
Month(x, fmt = "mm", lang="local")
Month(x, fmt = "mmm", lang="engl")
Month(x, fmt = "mmm", lang="local")
Week(x)
Day(x)
Day(x) <- 20
x
Weekday(x)
Weekday(x, fmt = "dd", lang="engl")
Weekday(x, fmt = "dd", lang="local")
Weekday(x, fmt = "ddd", lang="engl")
Weekday(x, fmt = "ddd", lang="local")
YearDay(x)
IsWeekend(x)
IsLeapYear(x)
# let's generate a time sequence by weeks
Month(seq(from=as.Date(Sys.Date()), to=Sys.Date()+150, by="weeks"), fmt="mm")
LastDayOfMonth(as.Date(c("2014-10-12","2013-01-31","2011-12-05")))
Run the code above in your browser using DataLab